home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
util
/
gnu
/
gnu_smalltalk1_2.lha
/
README-1.2
< prev
next >
Wrap
Text File
|
1992-02-18
|
4KB
|
131 lines
Brief overview of new features with version 1.2:
Emacs editing
* bugs fixed
* many Smalltalk mode commands are now available in the Smalltalk "shell"
mode
* new browser mode
once Smalltalk is built, you can invoke the browser from a Smalltalk mode
buffer by doing C-C C-B C-H (Browse Hierarchy). Commands in first window
are:
space (browse all instance methods)
d (browse direct methods),
i (browse indirect only methods),
c (browse class methods (all)).
From the generated method browser window, use space to select the
definition of the particular method, move to a different line, hit space
again to see that method's definition, etc.
The key bindings are likely to change to get more regular with time, and
there may be a way to see the class definition.
* C-c C-s shows all classes where the selector that's under the cursor is
defined, type a space to jump to the definition in the chosen class.
* Do c-c c-b c-o to load class names, then
c-c c-b c-d browses direct methods of a class (reads class name with
completion)
c-c c-b c-i browses indirect methods
c-c c-b c-c browses class methods
* C-c c-t defines a map which toggles various tracing facilities in the
running Smalltalk:
c-d for declaration tracing
c-e for execution tracing
c-v for verbose executation tracing
* there are probably other undiscovered treasures waiting to be found in the
emacs editing mode. c-c d is your friend!!!
Initialization files
* $HOME/.stpre is loaded before building the basic mst.im image
* $HOME/.stinit is loaded each time smalltalk starts up, whether or not
it build the saved mst.im image during the run, and is loaded after the
binary image has been saved.
Sun examples
C Pointer hacking
* provides direct access to C data structures including
o long (unsigned too)
o short (unsigned too)
o char (unsigned too) & byte type
o float (and double)
o string (NUL terminated sequence of char * )
o arrays of any type
o pointers to any type (I'm not happy with the semantics of this; it's
likely to change)
o structs containing any fixed size types
Example struct decl in C: (see sun/Sound.st for example usage)
struct audio_prinfo {
unsigned channels;
unsigned precision;
unsigned encoding;
unsigned gain;
unsigned port;
unsigned _xxx[4];
unsigned samples;
unsigned eof;
unsigned char pause;
unsigned char error;
unsigned char waiting;
unsigned char _ccc[3];
unsigned char open;
unsigned char active;
};
struct audio_info {
audio_prinfo_t play;
audio_prinfo_t record;
unsigned monitor_gain;
unsigned _yyy[4];
};
Equivalent in Smalltalk:
CStruct newStruct: #AudioPrinfo
declaration: #((sampleRate uLong)
(channels uLong)
(precision uLong)
(encoding uLong)
(gain uLong)
(port uLong)
(xxx (array uLong 4))
(samples uLong)
(eof uLong)
(pause uChar)
(error uChar)
(waiting uChar)
(ccc (array uChar 3))
(open uChar)
(active uChar))
!
CStruct newStruct: #AudioInfo
declaration: #((play AudioPrinfo)
(record AudioPrinfo)
(monitorGain uLong)
(yyy (array uLong 4))
)
!
C Callin
* needs no explicit initialization
* can initialize with command line arguments if desired (so as to control
when the smalltalk initialization occurs)
* smalltalk need not be main
Stix
* Provides full access to X protocol
* doesn't currently have support for resources
* ICCCM support not working yet
* See stix/README
Dynamic Linking
* based on the GNU DLD library
* allows Smalltalk to dynamically load and reference C code
* Has an example of use at the bottom